<?php
    header("Content-Type: text/html;charset=utf-8");
     //获取通知的数据
    require_once 'class.php';
    $wxappid           = 'wx0000000000000';//应用ID 字符串
    $mch_id            = '0000000000';//商户号 字符串
    $notify_url        = 'https://www.xxxxxxxxxx.com/wechat/notify.php';//接收微信支付异步通知回调地址 字符串
    $wxkey             = '000000000000000000000000';//这个是在商户中心设置的那个值用来生成签名时保证安全的 字符串
   
    $wechatAppPay = new wechatAppPay($wxappid, $mch_id, $notify_url, $wxkey);

    $data = $wechatAppPay->getNotifyData();  //获取微信的通知

    $data_sign = $data['sign']; //取得sign值

    unset($data['sign']); //去除sign

    $sign = $wechatAppPay->MakeSign($data);  //重新签名

    if($data_sign == $sign && $data['return_code'] == "success")  //验签，以及判断支付是否成功
    {
        $wechatAppPay->replayNotify();  //验签通过回复微信
    }

?>